package com.xhji.task.scheduler;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Component
public class SchedulerTask {

    @Scheduled(fixedRate = 6000)
    public void reportCurrentTime() {
        System.out.println("现在时间 fixedRate ：" + LocalDateTime.now());
    }

    @Scheduled(cron="*/6 * * * * ?")
    private void process(){
        System.out.println("现在时间 cron ：" + LocalDateTime.now());
    }
}
